import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

/**
 * @author liuliuliu
 */
public class threadTest {
    public static void main(String[] args) throws InterruptedException, ExecutionException {
        Callable testcallable = new testCallable();
        FutureTask task = new FutureTask(testcallable);
        new Thread(task).start();
        Thread.sleep(3);
        System.out.println(task.get());
    }

}

class testCallable implements Callable{

    @Override
    public Object call() throws Exception {
        Thread.sleep(2);
        return "线程启动";
    }
}
